package com.csthink.mr.sort.all;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @author <a href="mailto:csthink@icloud.com">Mars</a>
 * @since 2024-04-12 20:16
 */
public class AccessSortReducer extends Reducer<AccessStat, Text, NullWritable, AccessStat> {

    @Override
    protected void reduce(AccessStat key, Iterable<Text> values, Reducer<AccessStat, Text, NullWritable, AccessStat>.Context context) throws IOException, InterruptedException {
        for (Text value : values) {
            context.write(NullWritable.get(), key);
        }
    }
}
